<?php
header("content-type:text/html;charset=utf-8");
include "../../inc/common.simple.php";
$type=!empty($_GET['type']) && in_array($_GET['type'],array('sina','qq'))?$_GET['type']:'qq';
if($type=='qq')
{
	include "qq.class.php";
	$auth=new auth($setting['qq_appid'],$setting['qq_appkey'],$setting['site_url'].'/models/login/index.php?type=qq');
}
if(!empty($auth->app_key))
{
	if($_GET['code'])
	{
		print_r($auth->getUserInfo($_GET['code']));
	}
	else
	{
		$auth->login();
	}
}
else
{
	echo '网站未设置KEY,或者不支持此登录方式';
}
?>